<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="FBGraph.Web.Mvc.FBGraphViewPage<SearchData>" %>

<asp:Content ID="t" ContentPlaceHolderID="TitleContent" runat="server">Search: <%= Request.QueryString["query"] %></asp:Content>

<asp:Content ID="c" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Search: <%= Request.QueryString["query"] %></h2>
    
    <div class="section feed">
        <h3>Public Posts</h3>
        <div class="content">
            <% foreach (var post in Model.Posts) {
                Html.RenderPartial("Post", post);
            } %>
        </div>
    </div>
    
    <div class="section user-list">
        <h3>People</h3>
        <div class="content">
            <ul class="user-list">
                <% foreach (var user in Model.People) { %>                
                <li>
                    <img src="<%= this.FbContext.BuildRequestUri("picture", user.Id) %>" alt="<%= user.Name %>" />
                    <p><%= Html.ActionLink(user.Name, "detail", "profile", new { id = user.Id }, null)%></p>
                </li>
                <% } %>
                <br class="clear" />
            </ul>
        </div>
    </div>
    
    <div class="section user-list">
        <h3>Pages</h3>
        <div class="content">
            <ul class="user-list">
                <% foreach (var page in Model.Pages) { %>                
                <li>
                    <img src="<%= this.FbContext.BuildRequestUri("picture", page.Id) %>" alt="<%= page.Name %>" />
                    <p><%= Html.ActionLink(page.Name, "detail", "pages", new { id = page.Id }, null)%></p>
                </li>
                <% } %>
                <br class="clear" />            
            </ul>
        </div>
    </div>
    
    <div class="section feed">
        <h3>Events</h3>
        <div class="content">        
            <% foreach (var evnt in Model.Events) { %>
            <div class="event">
                <h3><%= Html.ActionLink(evnt.Name, "detail", new { id = evnt.Id }) %></h3>
                <div class="actions">
                    [<%= Html.ActionLink("Attending", "attend", new { id = evnt.Id }) %>]
                    [<%= Html.ActionLink("Maybe", "maybe", new { id = evnt.Id }) %>]
                    [<%= Html.ActionLink("Decline", "decline", new { id = evnt.Id }) %>]
                </div>
                <ul>
                    <li>Date/Time: <%= evnt.StartTime %>  - <%= evnt.EndTime %></li>
                    <li>Location: <%= evnt.Location %></li>
                </ul>
            </div>
            <% } %>
        </div>
    </div>
    
    <div class="section user-list">
        <h3>Groups</h3>
        <div class="content">
            <ul class="user-list">
                <% foreach (var group in Model.Groups) { %>                
                <li>
                    <img src="<%= this.FbContext.BuildRequestUri("picture", group.Id) %>" alt="<%= group.Name %>" />
                    <p><%= Html.ActionLink(group.Name, "detail", "groups", new { id = group.Id }, null)%></p>
                </li>
                <% } %>
                <br class="clear" />            
            </ul>        
        </div>
    </div>
    
    <div class="section feed">
        <h3>My News Feed</h3>
        <div class="content">
            <% foreach (var post in Model.Feed) {
                Html.RenderPartial("Post", post);
            } %>
        </div>
    </div>
    
    <br class="clear" />

</asp:Content>
